using System;
using System.Collections;

namespace Seaskyer.WebApp.Utility.BigUpload
{
	/// <summary>
	/// A simple collection class of upload file
	/// </summary>
	public class UploadFileCollection : ICollection, IEnumerable
	{
		#region Fields

		private ArrayList filelist;

		#endregion

		#region Properties

		/// <summary>
		/// 
		/// </summary>
		public int Count
		{
			get { return this.filelist.Count; }
		}

		#endregion

		#region Methods

		/// <summary>
		/// 
		/// </summary>
		public bool IsSynchronized
		{
			get { return this.filelist.IsSynchronized; }
		}

		/// <summary>
		/// 
		/// </summary>
		public UploadFile this[int index]
		{
			get { return ((UploadFile) this.filelist[index]); }
		}

		/// <summary>
		/// 
		/// </summary>
		public object SyncRoot
		{
			get { return this.filelist.SyncRoot; }
		}

		/// <summary>
		/// 
		/// </summary>
		public UploadFileCollection()
		{
			this.filelist = new ArrayList();
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="File"></param>
		public void Add(UploadFile File)
		{
			this.filelist.Add(File);
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="array"></param>
		/// <param name="index"></param>
		public void CopyTo(Array array, int index)
		{
			this.filelist.CopyTo(array, index);
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public IEnumerator GetEnumerator()
		{
			return this.filelist.GetEnumerator();
		}

		#endregion
	}

}